﻿//function clickSearch() {
//    let searchStr = $("#search-input").val();
//    console.log(searchStr);
//    if (searchStr.trim() == '') return;
//    // 跳转到指定的 URL 地址
//    location.href = "/Search/Index?searchStr=" + searchStr + "&page=1&StoreCategorysID=0&Area=0&parentCategoryID=0&RegionID=0";
//}

function clickSearch() {
    let searchStr = $("#search-input").val();
    console.log(searchStr);
    if (searchStr.trim() == '') return;
    let url = `searchStr=${searchStr}page=1&StoreCategorysID=0&Area=0&parentCategoryID=0&RegionID=0`;
    let obj = {
        searchStr: searchStr
    }
    let jsonStr = JSON.stringify(obj)
    jsonStr = btoa(jsonStr)//base64编码
/*    window.btoa(unescape(encodeURIComponent(jsonStr))); */
    jsonStr = encodeURIComponent(jsonStr)//URL编码
    $.ajax({
        url: '/Search/Index/' + jsonStr,
        success: function (e) {
            var tp = $(".serch-content");
            var np = $(e);
            tp.children().remove();
            np.find(".serch-content").children().appendTo($(".serch-content"));
        }
    })
}